In transmitting HDLC encoded information a variable number of data bits are transmitted between two delimiting flags--one at the beginning and one at the end. The flags and the data therebetween form a data frame. Unfortunately, a flag byte is transmitted as a series of bits which are possibly contained within the data. As such, data encoding--bit stuffing--is used to eliminate any occurrences of a flag bit sequence from within the data.
For example, a flag of 6 consecutive `1` bits preceded by a `0` bit and followed by a `0` bit indicates a frame beginning and a frame ending. During data transmission, when five consecutive `1` bits occur, a `0` bit is inserted after the fifth consecutive `1` bit to ensure that six consecutive `1` bits--a start frame flag or end frame flag--do not occur and that a reverse process of bit unstuffing is straightforward. For decoding of the encoded data, every time five `1` bits are detected, the following `0` bit is removed from the data. When the following bit is a `1` bit, it is a flag and appropriate processing of the frame occurs.
In serial communication, this results in a transmission of a greater number of bits for a number of input data bits. At the receiving end, the stuffed bits are removed and the number of input data bits is decoded. When transmitting a number of bytes, the method is not problematic because the bytes sent are the bytes received and only during bit stuffing, transmission, and bit unstuffing is the number of data bits effected. For example, a bit stream of sixteen consecutive one bits is encoded as a start frame flag, five consecutive `1` bits, a `0` bit, five consecutive `1` bits, a `0` bit, five consecutive `1` bits, a `0` bit, a `1` bit and an end frame flag. The total frame length is 8+5+1+5+1+5+1+1+8 or 35 bits. The number of bits is not an integral number of bytes--eight bits.
A second common approach to bit stuffing is used in byte level communication such as that used with modems. The method involves bit stuffing in a fixed bit length fashion to provide, for example, error detection. One common scheme is parity. In parity, a bit is added to every predetermined number of bytes. Usually the predetermined number is one. For each byte, a parity is determined and a bit indicating the parity is stuffed. When a bit is stuffed for each byte, this results in an increase in transmitted data of 12.5% --an undesirable amount.
The process of HDLC bit stuffing is designed to operate at substantially low communications speeds in the order of megabits. In order to perform encoding, a simple counter is used. Every one bit increments the counter; every zero bit resets the counter. When the counter reaches 5, a zero bit is stuffed and the counter is reset. Decoding is performed using a similar counter based system. The counter operates at a same speed as the data communications channel. Unfortunately, current communication paradigms are exceeding 25 Mbits per second, some carrying data at data rates over a Giga bit (1000 Mbits) per second. At these speeds, it is difficult to implement at low cost the HDLC bit stuffing circuits currently in use. Essentially, the effects of noise and other effects of high speed circuitry, renders such an HDLC more expensive and more difficult to design.
An encoder decoder for variable length codes is taught by Machado in U.S. Pat. No. 4,675,652 issued Jun. 23, 1987. The encoder encodes data in a fixed ratio of decoded to encoded bits. As such, the encoder decoder is not applicable to HDLC encoding wherein for each 8 bits of data, eight, nine or ten bits result.
In U.S. Pat. No. 5,583,500 in the name of Allen et al. and issued on Dec. 10, 1996, a method of encoding and decoding variable bit length data is presented. The patent discloses a system wherein code words are encoded and decoded in a variable length manner. During encoding, each code word is encoded separately and therefore, parallel encoding of code words is performed. During decoding, code word lengths are known and encoded data is divided into code words and allocated sufficient buffer memory for the decoded code word. The method is for use in video signal transmission.
Unfortunately, in HDLC encoding, a number of encoded bits is determined by bit contents and is not known in advance. Also, encoding of any bit requires knowledge of the previous 4 encoded bits. Because of these limitations, serial encoding of HDLC data is used as described above.
It would be advantageous to provide a means for transmitting HDLC encoded data signals via a packet oriented data network such as a Sonet network.
It would be advantageous to provide a low cost high speed HDLC encoding circuit.